/* 引入Normalize.css（外部样式文件） */
@import url("http://127.0.0.1:5500/xiamen/normalize.css");

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 透明导航栏样式 */
.header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent;
  z-index: 999;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 130px;
  transition: all 0.3s ease;
}

.logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 40px;
}

.logo-box img {
  height: 100px;
  width: auto;
  transition: height 0.3s ease;
}

.nav-text-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  height: 100%;
}

.header-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.user-nav a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s, text-shadow 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.user-nav a:hover {
  color: #337ab7 !important;
}

.en-link {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav-box {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 0;
}

.main-nav {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.main-nav li {
  position: relative;
  height: 100%;
}

.main-nav li::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 10px;
  z-index: 9998;
}

.main-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  height: 40px;
  text-decoration: none;
  font-size: 20px !important;
  color: white;
  transition: all 0.2s ease;
  text-shadow: 0 1px 2px rgba(250, 245, 245, 0.2);
}

.main-nav a:hover,
.main-nav a.active {
  color: #337ab7 !important;
}

/* 下拉菜单样式 */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  display: none;
  border: 1px solid #e0e0e0;
  border-top: 3px solid red;
  border-radius: 0;
  z-index: 9999;
}

.main-nav li:hover .dropdown-menu {
  display: block;
  animation: fadeIn 0.25s ease;
}

.dropdown-menu a {
  color: #666666 !important;
  text-shadow: none !important;
  border-bottom: 2px solid #f0f0f0;
  font-size: 19px;
  text-align: center;
  padding: 10px 10px;
  height: auto;
  line-height: normal;
}

.dropdown-menu a:hover {
  color: #0066cc !important;
  background: #f8f9fa;
}

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 轮播图区域 */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  padding-top: 130px;
  display: flex;
  flex-direction: column;
}

.slider {
  display: flex;
  width: 100%;
  height: 100%;
  flex: 1;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease;
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

/* 轮播控制按钮 */
.slider-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
}

.slider-controls button {
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.3s;
}

.slider-controls button:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* 轮播指示器 */
.slider-indicators {
  position: absolute;
  bottom: 30px;
  left: 30px;
  z-index: 2;
  display: flex;
  gap: 18px;
}

.indicator {
  width: 36px;
  height: 36px;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  color: #ffffff;
  text-align: center;
  line-height: 32px;
  padding: 0;
  border-bottom: 2px solid transparent;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.indicator:hover {
  color: #f0f8ff;
  transform: scale(1.05);
}

.indicator.active {
  background: #337ab7;
  color: #ffffff;
  font-weight: 500;
}

.indicator.active::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 2px;
  background: #ffffff;
}

.indicator:hover::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 2px;
  background: rgba(51, 122, 183, 0.5);
}

/* 新闻卡片列表模块 */
.news-cards {
  padding: 60px 0 0 0;
  background-image: url("https://www.xmu.edu.cn/images/news-bg.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  color: #fff;
  max-width: 100%;
  margin-bottom: 0;
}

.news-cards > .container {
  max-width: none;
  padding: 0;
}

/* 卡片网格布局 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 50px;
  margin-bottom: 30px;
  margin-left: 60px;
  margin-right: 60px;
}

/* 单张卡片样式 */
.card-item {
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
  height: 260px;
  display: flex;
  flex-direction: column;
}

.card-item:hover {
  transform: translateY(-5px);
}

.card-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-item p {
  padding: 15px;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  flex: 1;
}

/* 查看更多按钮 */
.view-more-btn {
  display: block;
  margin: 0 auto;
  padding: 10px 30px;
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.view-more-btn:hover {
  background: #fff;
  color: #4a47e0;
}

/* 新闻纵横 */
.media-xmu {
  background: #fff;
  padding: 0;
  margin-top: 0;
  text-align: center;
}

.media-header {
  display: flex;
  justify-content: center;
  background-image: url("https://www.xmu.edu.cn/images/news-title-bg.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  margin-bottom: 20px;
  padding: 50px 0;
  margin-top: 30px;
}

.media-tab {
  padding: 18px 28px;
  height: 20px;
  cursor: pointer;
  font-size: 24px;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.media-content .tab-panel {
  display: none;
}

.media-content .tab-panel.active {
  display: block;
}

/* 媒体标签黄色激活状态 */
.media-tab.active {
  color: #ffd407 !important;
}

/* 新闻列表 */
.media-icon img {
  width: 100%;
  max-width: 49px;
  margin-right: 20px;
}

.news-list {
  margin-left: 100px;
  margin-right: 100px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0px 15px;
}

.news-item {
  padding: 15px 0;
  border-bottom: 2px solid rgba(121, 121, 124, 0.5);
  display: flex;
  transition: all 0.3s ease;
}

.news-item:hover {
  box-shadow: 0 0 10px #969696;
  -webkit-box-shadow: 0 0 10px #969696;
}

.news-info {
  flex: 1;
  text-align: left;
}

.news-title {
  color: #005ea7;
  font-size: 14px;
  text-decoration: none;
  display: block;
  margin-bottom: 5px;
  transition: color 0.3s ease;
  text-align: left;
}

.news-title:hover {
  color: #c87f00;
}

.news-desc {
  color: #666;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

/* 新闻日期 */
.news-date {
  color: #999;
  font-size: 11px;
  float: left;
  margin-top: 5px;
}

.view-more {
  display: block;
  width: 120px;
  margin: 20px auto 0;
  text-align: center;
  color: #005ea7;
  text-decoration: none;
  border: 1px solid #005ea7;
  padding: 8px 15px;
  border-radius: 4px;
  transition: all 0.3s ease;
  clear: both;
  float: none;
  margin-left: auto;
  margin-right: auto;
}

.view-more:hover {
  background: #005ea7;
  color: #fff;
}

/* 学校简介 */
.about {
  padding: 60px 0;
  background-color: white;
}

.about h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #1a5e9a;
  font-size: 2rem;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: center;
}

.about-img {
  flex: 1;
  min-width: 300px;
}

.about-img img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.about-text {
  flex: 1;
  min-width: 300px;
  text-align: left;
}

.about-content p {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.more-btn {
  display: inline-block;
  background-color: #1a5e9a;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s;
  margin-top: 10px;
}

.more-btn:hover {
  background-color: #0f4c81;
}

/* 最新公告 */
.news {
  padding: 60px 0;
  background-color: #f0f5f9;
}

.news h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #1a5e9a;
  font-size: 2rem;
}

.date {
  color: #666;
  margin-right: 20px;
  min-width: 100px;
}

/* 更多公告 */
.more-news {
  display: block;
  text-align: center;
  margin-top: 30px;
  color: #1a5e9a;
  text-decoration: none;
}

.more-news:hover {
  text-decoration: underline;
}

/* 校园活动 */
.events {
  padding: 60px 0;
  background-color: white;
}

.events h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #1a5e9a;
  font-size: 2rem;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.event-card {
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.event-card:hover {
  transform: translateY(-5px);
}

.event-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.event-info {
  padding: 20px;
}

.event-info h3 {
  margin-bottom: 10px;
  color: #1a5e9a;
}

.event-date {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.event-link {
  color: #1a5e9a;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}

.event-link:hover {
  text-decoration: underline;
}

/* 页脚样式 */
footer {
  background-image: url("https://www.xmu.edu.cn/images/footer-bg.jpg");
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  color: white;
  padding: 90px 0;
  position: relative;
}

.footer-top-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-icon-group {
  display: flex;
  gap: 170px;
  margin-top: 70px;
}

.footer-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-icon-item i {
  font-size: 6rem;
  margin-bottom: 20px;
  color: #fff;
  border-radius: 70%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.footer-quick-links {
  margin-top: 30px;
  width: 30%;
}

.footer-quick-links h3 {
  margin-bottom: 40px;
  font-size: 2rem;
  position: relative;
  padding-bottom: 10px;
}

.footer-quick-links h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background-color: #fff;
}

.quick-links-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  list-style: none;
}

.quick-links-list li a {
  color: #ddd;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 18px;
}

.quick-links-list li a:hover {
  color: white;
}

.footer-bottom {
  padding-top: 30px;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 30px;
}

.footer-logo img {
  height: 80px;
  width: auto;
}

.footer-contact p {
  margin-bottom: 2px;
  font-size: 17px;
  color: #ddd;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.social-icon {
  display: inline-block;
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background-color 0.3s;
}

.social-icon:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.copyright {
  text-align: left;
  font-size: 1rem;
  color: #ddd;
  padding-top: 8px;
  margin-top: 10px;
  border-top: 2px solid rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  position: absolute;
  bottom: 10px;
  left: 20px;
  width: calc(100% - 40px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hamburger-btn {
    display: block;
  }

  .user-nav {
    display: none;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.9);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 20px 0;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav a {
    font-size: 18px !important;
    padding: 12px 0;
    width: 100%;
  }

  .dropdown-menu {
    min-width: 100%;
    left: 0;
    transform: none;
  }
}